package com.cwh.taskcenter.domain.notice.model;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author cwh
 */
@Getter
@AllArgsConstructor
public enum ChannelType {
    SMS("SMS", "短信通知"),
    INBOX("INBOX", "站内信"),
    POPUP("POPUP", "弹窗通知"),
    EMAIL("EMAIL", "邮件通知"),
    APP_PUSH("APP_PUSH", "APP推送");

    private final String code;
    private final String description;

    public static ChannelType fromCode(String channelType) {
        for (ChannelType value : values()) {
            if (value.code.equals(channelType)) {
                return value;
            }
        }
        return null;
    }
}
